<?=view('admin.common.header')?>
<?=view('admin.common.nav')?>
<div class="container">
    <div class="row">
        <ul class="nav nav-pills" style="margin-bottom: 20px;">
            <li role="presentation"><a href="?pushstatus=1">申请中</a></li>
            <li role="presentation"><a href="?pushstatus=2">已打款</a></li>
            <li role="presentation"><a href="?pushstatus=3">审核未通过</a></li>
        </ul>
        <?php if($accounts && count($accounts)): ?>
        <div class="panel panel-default">
            <div class="panel-heading">
                提现
            </div>
            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th>提现金额</th>
                        <th>申请时间</th>
                        <th>联系电话</th>
                        <th>备注</th>
                        <th>管理员操作时间</th>
                        <th>操作备注</th>
                        <th>#</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($accounts as $val): ?>
                    <tr>
                        <td><?=$val->money?></td>
                        <td><?=$val->strTime()?></td>
                        <td><?=$val->phone?></td>
                        <td><?=$val->mark?></td>
                        <td><?=$val->strPushTime()?></td>
                        <td><?=$val->adminmark?></td>
                        <td>
                            <table id="info<?=$val->id?>" class="table" style="display: none;">
                                <?=$val->strBankInfo()?>
                            </table>
                            <a href="#" data-info="<?=$val->id?>" class="btn btn-info btn-xs eveInfo">收款帐号</a>
                            <?php if ($val->isInfoFull() && in_array($val->pushstatus, array(1))): ?>
                            <a href="<?=url("admin/account/edit/{$val->id}/2")?>" class="btn btn-success btn-xs eveModify">通过审核并打款</a>
                            <?php endif; ?>
                            <?php if (in_array($val->pushstatus, array(1))): ?>
                            <a href="<?=url("admin/account/edit/{$val->id}/3")?>" class="btn btn-danger btn-xs eveModify">不通过</a>
                            <?php endif; ?>
                        </td>
                    </tr>
                    <?php endforeach; ?>
                </tbody>
            </table>
        </div>
        <?=$accounts->render()?>
        <?php endif; ?>
    </div>
</div>
<script>
$(".eveInfo").click(function(){
    var infoid = '#info'+$(this).attr('data-info');
    layer.open({
        type: 1,
        title: '订单详情',
        shadeClose: true,
        shade: 0.8,
        area: ['380px', '300px'],
        content:  $(infoid),
    });
    return false;
});
$('.eveModify').click(function(){
    var url = $(this).attr('href');
    layer.open({
        type: 2,
        title: '管理员操作',
        shadeClose: false,
        shade: 0.8,
        area: ['380px', '300px'],
        content:  url,
    });
    return false;
});
var msg = '<?=$msg?>';
if (msg != '') {
    layer.msg(msg);
}
</script>

<?=view('admin.common.footer')?>